package YOONA;

import YOONA.bean.user;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/c")
public class c extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        user user = new user();
        user.setId("1111");
        user.setName("杰克");

        req.setAttribute("userobj",user);
//        req.getRequestDispatcher("/d").forward(req, resp);
        resp.sendRedirect(req.getContextPath()+"/d");//需要以项目名开始或者说需要加项目名
    }
}
